import React, { PureComponent } from 'react';
import '@ant-design/compatible/assets/index.css';
import { connect } from 'dva';
import moment from 'moment';
import { getToken } from '@/components/common/PateoForm/utils/helper';
import { Modal, Badge, Card, message, Table, Row, Col, Button, Popconfirm } from 'antd';
import * as G from '@/utils/common';
import PateoTable from '@/components/common/PateoTable';
import PateoSearchForm from '@/components/common/PateoSearchForm';
import PateoAuthButtons from '@/components/common/PateoAuthButtons';
import styles from '@/components/common/PateoTable/TableList.less';

const mapStateToProps = (state: any) => ({
  // loading: state.loading.models[""],
  batteryMonitoringTaskCenter: state.batteryMonitoringTaskCenter,
});

class TaskCenter extends PureComponent<any, any> {

  constructor(props: any) {
    super(props);
    this.state = {
      formValues: {},
      typeList: [
        {
          value: '0', label: '导入',
        },
        {
          value: '1', label: '导出',
        }
      ],
    };
  }

  componentDidMount() {
    const {onRef} = this.props
    onRef && onRef(this);
  }

  componentDidUpdate(prevProps: any) {
    const { modalVisible, dispatch } = this.props
    if (modalVisible && modalVisible !== prevProps.modalVisible) {
      //  打开弹窗
      console.log('打开弹窗')
    }
  }

  close = () => {
    const { closeModal } = this.props;
    closeModal();
  };

  render() {
    const { modalVisible } = this.props;
    // const {} = this.state
    return (
      <Modal
        title="任务中心"
        width={900}
        bodyStyle={{ maxHeight: '700px' }}
        footer={null}
        visible={modalVisible}
        onCancel={this.close}
      >
      </Modal>
    )
  }
}

export default connect(mapStateToProps)(TaskCenter);
